<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/axios-0.18.0.js"></script>
    <script src="js/vue-v2.6.10.js"></script>
</head>
<body>
  <div id="app">
      欢迎 {{user.realname}} 登录主页
  </div>

</body>
</html>
<script>
    new Vue({
        el: "#app",
        data: {
           user:{}
        },
        methods: {
            initUser(){
            //从session中获取用户信息
                this.user = JSON.parse(sessionStorage.getItem("user"));
            }
        },
        created(){
            this.initUser();
        }
    })
</script>